﻿#region Imports

using System;
using System.Collections.Generic;
using System.Text;
using d3PrtDgn.Core.BaseData;
using d3PrtDgn.Data.Domain.Entity;

#endregion

namespace d3PrtDgn.Data.IDAO
{
	/// <summary>
	/// Photo data access object interface
	/// </summary>
    public interface IPhotoDao : IBaseDao
    {
		/// <summary>
		/// Saves or updates photo
		/// </summary>
		/// <param name="photo">Photo to save or update</param>
		/// <returns>Saved or updated photo</returns>
		Photo SaveOrUpdate(Photo photo);

		/// <summary>
		/// Loads photo by ID
		/// </summary>
		/// <param name="id">Photo ID</param>
		/// <returns>Loaded photo</returns>
		Photo FindById(int id);

		/// <summary>
		/// Deletes photo
		/// </summary>
		/// <param name="photo">Photo to delete</param>
		void Delete(Photo photo);

		/// <summary>
		/// Checks if photo abbreviation is unique in specified context
		/// </summary>
		/// <param name="abbreviation">Abbreviation to check</param>
		/// <param name="id">Allowed duplicate abbreviation ID</param>
		/// <returns>Flag if abbreviation is unique</returns>
    	bool IsUnique(string abbreviation, int id);

		/// <summary>
		/// Loads photo by abbreviation
		/// </summary>
		/// <param name="abbrev">Abbreviation</param>
		/// <param name="owner">Owner for private album</param>
		/// <returns>Loaded photo</returns>
    	Photo FindByAbbreviation(string abbrev, User owner);
    }
}
